home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / recode.lha / recode-3.2.4 / txteasci.l < prev    next >
Text File  |  1992-08-19  |  3KB  |  85 lines

  1. %{
  2. /* Conversion of files between different charsets and usages.
  3.    Copyright (C) 1990 Free Software Foundation, Inc.
  4.    Francois Pinard <pinard@iro.umontreal.ca>, 1988.
  5.  
  6.    This program is free software; you can redistribute it and/or modify
  7.    it under the terms of the GNU General Public License as published by
  8.    the Free Software Foundation; either version 2, or (at your option)
  9.    any later version.
  10.  
  11.    This program is distributed in the hope that it will be useful, but
  12.    WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.    General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License
  17.    along with this program; if not, write to the Free Software
  18.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20.  
  21. #define STEP    texte_ascii
  22.  
  23. extern char diaeresis_char;    /* Character for diaeresis */
  24.  
  25. void
  26. texte_ascii_diaeresis (void)
  27. {
  28.   int counter;
  29.  
  30.   for (counter = 0; counter < yyleng; counter++)
  31.     if (yytext[counter+1] == diaeresis_char)
  32.       {
  33.     output ('"');
  34.     output ('\b');
  35.     output (yytext[counter]);
  36.     counter++;
  37.       }
  38.     else
  39.       output (yytext[counter]);
  40. }
  41. %}
  42.  
  43. s            (^|[^a-zA-Z])
  44. d            [:"]
  45. l            [a-zA-Z]
  46.  
  47. %%
  48. [eE]'''            { output ('\''); output ('\b'); output (yytext[0]);
  49.               output ('"'); output ('\b'); output ('>'); }
  50. [eE]''            { output (yytext[0]);
  51.               output ('"'); output ('\b'); output ('>'); }
  52. [eE]'            { output ('\''); output ('\b'); output (yytext[0]); }
  53. [aAeEiIoOuU][`^]    { output (yytext[1]); output ('\b');
  54.               output (yytext[0]); } 
  55. [cC]\,/[aAoOuU]        { output (','); output ('\b'); output (yytext[0]); }
  56. [aAeEiIoOuU]{d}/{l}    { output ('"'); output ('\b'); output (yytext[0]); } 
  57.  
  58. {s}[Bb]esaigue{d}    { texte_ascii_diaeresis (); }
  59. {s}[Cc]igue{d}        { texte_ascii_diaeresis (); }
  60. {s}[Aa]igue{d}        { texte_ascii_diaeresis (); }
  61. {s}[Aa]mbigue{d}    { texte_ascii_diaeresis (); }
  62. {s}[Cc]ontigue{d}    { texte_ascii_diaeresis (); }
  63. {s}[Ee]xigue{d}        { texte_ascii_diaeresis (); }
  64. {s}[Ss]ubaigue{d}    { texte_ascii_diaeresis (); }
  65. {s}[Ss]uraigue{d}    { texte_ascii_diaeresis (); }
  66. {s}[Aa]i{d}        { texte_ascii_diaeresis (); }
  67. {s}[Cc]ongai{d}        { texte_ascii_diaeresis (); }
  68. {s}[Gg]oi{d}        { texte_ascii_diaeresis (); }
  69. {s}[Hh]ai{d}kai{d}    { if (yytext[4] == diaeresis_char)
  70.                 texte_ascii_diaeresis ();
  71.               else
  72.                 ECHO;
  73.             }
  74. {s}[Ii]noui{d}        { texte_ascii_diaeresis (); }
  75. [JjTtLl]'[Aa][Ii]{d}    { ECHO; }
  76. {s}[Ss]ai{d}        { texte_ascii_diaeresis (); }
  77. {s}[Ss]amurai{d}    { texte_ascii_diaeresis (); }
  78. {s}[Tt]hai{d}        { texte_ascii_diaeresis (); }
  79. {s}[Tt]okai{d}        { texte_ascii_diaeresis (); }
  80. {s}[Cc]anoe{d}        { texte_ascii_diaeresis (); }
  81. {s}Esau{d}        { texte_ascii_diaeresis (); }
  82.  
  83. ``            { output ('"'); output ('\b'); output ('<'); }
  84. ''            { output ('"'); output ('\b'); output ('>'); }
  85.